package com.yanqu.road.entity.activity.ghost.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_ghost_boss")
public class GhostBossConfig {

    @FieldTypeAnnotation(desc = "活动ID", select = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "类型")
    private int bossType;
    @FieldTypeAnnotation(desc = "基础血量")
    private int hp;
    @FieldTypeAnnotation(desc = "血量占比")
    private int hpPer;
    @FieldTypeAnnotation(desc = "击杀积分奖励参数")
    private int rewardsKill;
    @FieldTypeAnnotation(desc = "奖励")
    private String rewards;
    @FieldTypeAnnotation(desc = "权重")
    private int weight;
    @FieldTypeAnnotation(desc = "是否击杀公告")
    private boolean notice;
    @FieldTypeAnnotation(desc = "是否最终boss")
    private boolean bigBoss;
    @FieldTypeAnnotation(desc = "形象")
    private int npcId;
    @FieldTypeAnnotation(desc = "随机奖励")
    private String randomReward;

    // 冗余
    private List<String> randomRewardList = new ArrayList<>();
    private List<Integer> randomWeightList = new ArrayList<>();

    public List<String> getRandomRewardList() {
        return randomRewardList;
    }

    public List<Integer> getRandomWeightList() {
        return randomWeightList;
    }

    public String getRandomReward() {
        return randomReward;
    }

    public void setRandomReward(String randomReward) {
        // randomReward：奖励,权重|奖励,权重|奖励,权重
        List<String> rewardList = new ArrayList<>();
        List<Integer> weightList = new ArrayList<>();
        List<String> itemList = StringUtils.stringToStringList(randomReward, "\\|");
        for (String item : itemList) {
            List<String> itemParam = StringUtils.stringToStringList(item, ",");
            rewardList.add(itemParam.get(0));
            weightList.add(Integer.valueOf(itemParam.get(1)));
        }
        this.randomRewardList = rewardList;
        this.randomWeightList = weightList;
        this.randomReward = randomReward;
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getBossType() {
        return bossType;
    }

    public void setBossType(int bossType) {
        this.bossType = bossType;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getHpPer() {
        return hpPer;
    }

    public void setHpPer(int hpPer) {
        this.hpPer = hpPer;
    }

    public String getRewards() {
        return rewards;
    }

    public void setRewards(String rewards) {
        this.rewards = rewards;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public boolean isNotice() {
        return notice;
    }

    public void setNotice(boolean notice) {
        this.notice = notice;
    }

    public boolean isBigBoss() {
        return bigBoss;
    }

    public void setBigBoss(boolean bigBoss) {
        this.bigBoss = bigBoss;
    }

    public int getNpcId() {
        return npcId;
    }

    public void setNpcId(int npcId) {
        this.npcId = npcId;
    }

    public int getRewardsKill() {
        return rewardsKill;
    }

    public void setRewardsKill(int rewardsKill) {
        this.rewardsKill = rewardsKill;
    }
}
